package com.platform.task;

import com.platform.service.ApiOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("orderTask")
public class OrderTask {
    private Logger logger = LoggerFactory.getLogger(getClass());


    @Autowired
    ApiOrderService apiOrderService;

    public void confirmOrder() {
        logger.info("我是自动确认订单的方法，正在被执行");

        apiOrderService.updateConfirmOrder(null);

        logger.info("我是自动确认订单的方法，执行已完成");
    }

    public void cancleOrder() {
        logger.info("我是自动取消订单的方法，正在被执行");

        apiOrderService.updateTimeOutOrder(null);

        logger.info("我是自动取消订单的方法，执行已完成");
    }
}
